package com.chenxin.common.core.domain;

import lombok.Data;

import java.io.Serializable;

/**
 * 业务过程返回结果
 */
@Data
public class DeviceResult implements Serializable {
    private static final long serialVersionUID = 1L;

    private Boolean success;
    private String msg;
    private Object data;

    public DeviceResult(Boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }

    public DeviceResult(Boolean success, String msg, Object data) {
        this.success = success;
        this.msg = msg;
        this.data = data;
    }

    public static DeviceResult success(String msg) {
        return new DeviceResult(true, msg);
    }

    public static DeviceResult success(String msg, Object data) {
        return new DeviceResult(true, msg, data);
    }

    public static DeviceResult error(String msg) {
        return new DeviceResult(false, msg);
    }

    public static DeviceResult error(String msg, Object data) {
        return new DeviceResult(false, msg, data);
    }


}
